package com.example.bob.uicontrols;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.RadioButton;

/**
 * Created by Bob on 2016/3/11.
 */
public class AtyUsingRadioGroup extends Activity {

    private RadioButton radioRight;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.aty_using_radiogroup);
        radioRight = (RadioButton) findViewById(R.id.radioRight);
        findViewById(R.id.btnSubmit).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (radioRight.isChecked()) {
//                    new AlertDialog.Builder(AtyUsingRadioGroup.this).setTitle("判断").setMessage("回答正确").setPositiveButton("关闭", new DialogInterface.OnClickListener() {
//                        @Override
//                        public void onClick(DialogInterface dialogInterface, int i) {
//
//                        }
//                    }).show();
                    new AlertDialog.Builder(AtyUsingRadioGroup.this).setTitle("判断").setMessage("回答正确").setPositiveButton("关闭", null).show();
                }else{
                    new AlertDialog.Builder(AtyUsingRadioGroup.this).setTitle("判断").setMessage("回答错误").setPositiveButton("关闭", null).show();
                }
            }
        });
    }
}
